import request from '@/utils/request';
// 查询工作空间列表
export const getTaskWorkspaceList = (query) => {
  return request({
    url: '/report/taskWorkspace/list',
    method: 'get',
    params: query
  });
};
// 删除工作空间
export const deleteTaskWorkspace = (ids: string | number) => {
  return request({
    url: '/report/taskWorkspace/delete/' + ids,
    method: 'delete'
  });
};

//新增工作空间
export const addTaskWorkspace = (data) => {
  return request({
    url: '/report/taskWorkspace/create',
    method: 'post',
    data
  });
};
//修改工作空间
export const editTaskWorkspace = (data) => {
  return request({
    url: '/report/taskWorkspace/edit',
    method: 'post',
    data
  });
};
//获取工作空间详情
export const getTaskWorkspaceDetail = (id: string | number) => {
  return request({
    url: `/report/taskWorkspace/detail/${id}`,
    method: 'get'
  });
};
//查询运行脚本列表
export const listLatestRunChain = (data) => {
  return request({
    url: `/report/taskChain/listLatestRunChain`,
    method: 'get',
    params: data
  });
};
//查询任务链配置详情
export const runChainDetail = (id) => {
  return request({
    url: `/report/taskChain/runChainDetail/${id}`,
    method: 'get'
  });
};
//[配置]修改任务链配置
export const editRunChainParams = (data) => {
  return request({
    url: `/report/taskChain/editRunChainParams`,
    method: 'post',
    data
  });
};
//[配置]修改任务链配置
export const listConfig = () => {
  return request({
    url: `/report/taskChain/listConfig`,
    method: 'get'
  });
};
//[运行]2初始化任务链列表
export const initTaskChains = (data) => {
  return request({
    url: `/report/taskChain/initTaskChains`,
    method: 'post',
    data
  });
};
//[运行]1生成任务链列表参数
export const genTaskChainParam = (data) => {
  return request({
    url: `/report/taskChain/genTaskChainParam`,
    method: 'post',
    data
  });
};
//[运行]3执行任务链列表
export const runTaskChains = (data) => {
  return request({
    url: `/report/taskChain/runTaskChains`,
    method: 'post',
    data
  });
};
//[运行]3执行任务链列表
export const deleteRunChainRuns = (ids) => {
  return request({
    url: `/report/taskChain/deleteRunChainRuns/${ids}`,
    method: 'delete'
  });
};